Skip to content

[feat] #78 - 집중 모드#82

Merged
laura-jung merged 4 commits into
developfrom
feat/#78-focus
Jul 9, 2026
Merged

[feat] #78 - 집중 모드#82
laura-jung merged 4 commits into
developfrom
feat/#78-focus

Conversation

@laura-jung

@laura-jung laura-jung commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

관련 이슈 🛠

작업 내용 요약 ✏️

집중 모드 api

주요 변경 사항 🛠️

  • 오늘 TODO 중 미완료인 최상단(sortOrder 최소) TODO 하나를 조회합니다
  • 응답은 세 상황 모두 200이지만 message가 다릅니다. TODO가 없는 경우와 모두 완료한 경우는 body가 hasTodo: false, todo: null로 동일해서 body만으로 구분할 수 없기 때문에, 서비스가 FocusTodoResult(successCode, response)를 반환하고 컨트롤러가 그 코드로 BaseResponse를 만듭니다. ReissueResult와 같은 패턴입니다.

트러블 슈팅 ⚽️

없습니당

스크린샷 📷

같은 todo를 너무 많이 만들어서 정확한지는 잘 모르겠지만.... 일단 되었습니다...
스크린샷 2026-07-09 오후 8 33 03

리뷰 요구사항 📢

없어용

Summary by CodeRabbit

  • New Features
    • 집중 모드에서 오늘의 할 일을 조회하는 기능이 추가되었습니다.
    • 오늘 일정에 맞는 첫 번째 미완료 할 일을 우선으로 보여주며, 날짜·요일·상세 정보도 함께 제공합니다.
  • Bug Fixes
    • 오늘 할 일이 없거나 이미 모두 완료된 경우에도 적절한 응답이 반환되도록 개선되었습니다.
    • 사용자 기준의 오늘 날짜를 반영해 더 정확한 할 일 결과를 제공합니다.

@laura-jung laura-jung requested review from Jy000n and aneykrap July 9, 2026 11:43
@laura-jung laura-jung self-assigned this Jul 9, 2026
@laura-jung laura-jung linked an issue Jul 9, 2026 that may be closed by this pull request
1 task
@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: bcb6dc93-a0db-44f9-b006-9532f19c72ce

📥 Commits

Reviewing files that changed from the base of the PR and between 4688ca6 and da74d8c.

⛔ Files ignored due to path filters (1)
  • src/main/java/com/Timo/Timo/domain/focus/docs/FocusControllerDocs.java is excluded by !**/docs/**
📒 Files selected for processing (5)
  • src/main/java/com/Timo/Timo/domain/focus/controller/FocusController.java
  • src/main/java/com/Timo/Timo/domain/focus/dto/FocusTodoResult.java
  • src/main/java/com/Timo/Timo/domain/focus/dto/response/FocusTodoResponse.java
  • src/main/java/com/Timo/Timo/domain/focus/exception/FocusSuccessCode.java
  • src/main/java/com/Timo/Timo/domain/focus/service/FocusService.java

Walkthrough

사용자의 오늘 투두를 조회하는 집중모드 API가 신규 추가되었다. FocusController가 GET /api/v1/focus 엔드포인트를 제공하고, FocusService가 사용자 타임존 기준 오늘 투두를 조회해 NO_TODO_TODAY, GET_FOCUS_TODO, ALL_TODO_COMPLETED 상태를 판단한다. FocusTodoResponse, FocusTodoResult, FocusSuccessCode가 응답 및 성공 코드 구조를 정의한다.

Changes

집중모드 조회 기능

Layer / File(s) Summary
응답 DTO 및 성공 코드 정의
src/main/java/com/Timo/Timo/domain/focus/dto/response/FocusTodoResponse.java, src/main/java/com/Timo/Timo/domain/focus/dto/FocusTodoResult.java, src/main/java/com/Timo/Timo/domain/focus/exception/FocusSuccessCode.java
FocusTodoResponse/FocusTodoDetailResponse 레코드가 날짜, 요일, 투두 존재 여부와 상세 정보를 담고, FocusTodoResult가 성공 코드와 응답을 함께 전달하며, FocusSuccessCode enum이 GET_FOCUS_TODO/NO_TODO_TODAY/ALL_TODO_COMPLETED 상태별 HTTP 상태와 메시지를 정의한다.
FocusService 조회 로직
src/main/java/com/Timo/Timo/domain/focus/service/FocusService.java
FocusService가 사용자 타임존 기준 오늘 투두를 로드/정렬해 비어있음, 미완료 투두 존재, 전체 완료 케이스를 구분해 처리하고, 사용자 미존재 시 CustomException을 던진다.
FocusController 엔드포인트
src/main/java/com/Timo/Timo/domain/focus/controller/FocusController.java
GET /api/v1/focus가 인증 사용자 정보로 FocusService를 호출하고 BaseResponse로 감싼 응답을 반환한다.

Estimated code review effort: 2 (Simple) | ~15 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant FocusController
  participant FocusService
  participant HomeTodoReader
  participant UserRepository

  Client->>FocusController: GET /api/v1/focus
  FocusController->>FocusService: getFocusTodo(userId)
  FocusService->>UserRepository: findById(userId)
  UserRepository-->>FocusService: User
  FocusService->>HomeTodoReader: load(오늘 범위)
  HomeTodoReader-->>FocusService: 투두 목록
  FocusService-->>FocusController: FocusTodoResult(successCode, response)
  FocusController-->>Client: BaseResponse<FocusTodoResponse>
Loading

Suggested labels: 🌸 자윤
Suggested reviewers: Jy000n, aneykrap

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목이 집중모드 기능 추가라는 핵심 변경을 간결하게 잘 나타냅니다.
Linked Issues check ✅ Passed #78의 집중모드 조회 API 구현 요구가 엔드포인트, 서비스, 응답 DTO로 충족됩니다.
Out of Scope Changes check ✅ Passed 추가된 변경은 집중모드 조회 API 구현에 한정되어 있고 명확한 범위 이탈은 보이지 않습니다.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/#78-focus

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added ✨ feat and removed ✨ feat labels Jul 9, 2026

@Jy000n Jy000n left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

로직들도 깔끔하게 분리되어 있고 좋은 것 같습니다-!!

public record FocusTodoResult(
FocusSuccessCode successCode,
FocusTodoResponse response
) { }

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이것도 여백으로 치나요 안 치나요 상관없나요 (동글둥글당글딩글)

Comment on lines +16 to +17
ALL_TODO_COMPLETED(HttpStatus.OK, "오늘의 TODO를 모두 완료했습니다."),
;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

유레카!! 저도 반영하겠습니다

@aneykrap aneykrap left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

집중모드 안녕!!!!!!!!!가라

List<TodoResponse> todos = homeTodoReader.sortedTodosOn(loaded, today);

if (todos.isEmpty()) {
return new FocusTodoResult(FocusSuccessCode.NO_TODO_TODAY, FocusTodoResponse.empty(today));

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO 없음 , 모두 완료 , 조회 성공 케이스를 FocusTodoResult로 successCode와 response를 같이 넘기도록 분리 깔끔하네용 PR 설명에 적힌 의도도 코드에서 잘 드러나는 것 같습니다!

Comment on lines +6 to +8
import com.Timo.Timo.domain.home.dto.response.HomeResponse.SubtaskResponse;
import com.Timo.Timo.domain.home.dto.response.HomeResponse.TagResponse;
import com.Timo.Timo.domain.home.dto.response.HomeResponse.TodoResponse;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p4) Focus 응답 DTO가 Home 응답 DTO(TodoResponse, TagResponse, SubtaskResponse)에 직접 의존하고 있어서 Home API 응답 구조가 바뀌면 Focus API에도 같이 영향이 갈 수 있지 않나 싶었어용

Home과 동일한 응답 구조를 의도적으로 재사용하는 거라면 굿굿슨이지만 Focus API를 독립적으로 가져갈 계획이라면 전용 DTO로 분리하는 것도 좋을 것 같다는 말이었어용

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

focus의 경우 home의 오늘 조회와 유사해서 재사용을 노렸습니다. 이후 focus와 관련된 api가 늘어난다면 따로분리하는게 좋을 것 같네용

@laura-jung laura-jung requested a review from aneykrap July 9, 2026 17:58
@github-actions github-actions Bot added the slack-approval-notified Slack 승인 완료 알림 중복 방지용 라벨 label Jul 9, 2026
@laura-jung laura-jung merged commit 2d7258c into develop Jul 9, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ feat slack-approval-notified Slack 승인 완료 알림 중복 방지용 라벨 🍀 윤아

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feat] 집중모드

3 participants